<table class="layui-table" style="width:2400px;" id="contentTab">
 	<input type="hidden" id="outboundId" th:value="${stockOutbound.id}"/>
 	<input type="hidden" id="companyId" th:value="${stockOutbound.companyId}"/>
 	<input type="hidden" id="billNo" th:value="${stockOutbound.billNo}"/>
 	<input type="hidden" id="customerId" th:value="${stockOutbound.customerId}"/>
  <thead>
    <tr>
    	 <th><input type="checkBox" lay-skin="primary" name="headCheckBox" lay-filter="headCheckBox"/></th>
      	 <th>出库单编号</th>
		 <th>物料编码</th>
		 <th>物料名称</th>
		 <th>物料规格</th>
		 <th>物料类型</th>
		 <th>品牌</th>
		 <th>计量单位</th>
		 <th>出仓库</th>
		 <th>客户物料编码</th>
		 <th>客户物料名称</th>
		 <th>客户物料规格</th>
		 <th>应发数量</th>
		 <th>已发数量</th>
		 <th>本次数量</th>
		 <th>是否赠品</th>
		 <th>单价</th>
		 <th>出库日期</th>
    </tr>
     </thead>
    <tbody>
   
    <tr th:each="item : ${details}">
    	<td><input type="checkBox" lay-skin="primary" name="trCheckBox"/></td>
		<td style="width:50px"><input type="hidden" name="id" th:value="${item.id}"/><input type="hidden" name="outboundId" th:value="${item.outboundId}"/><span th:text="${item.billNo}"></span></td>
		<td>
			<input type="text" name="materiaCode" class="layui-input" style="width:120px;" th:value="${item.materiaCode}"/>
			<input type="hidden" name="materialId" class="layui-input"  th:value="${item.materialId}"/>
		</td>
		<td name='materiaName' style="background-color:#f3f2f2;width:200px;" th:text="${item.materiaName}"></td>
		<td name='materiaSpec' style="background-color:#f3f2f2" th:text="${item.materiaSpec}"></td>
		<td name="materiaType" style="background-color:#f3f2f2" th:text="${item.materiaType}"></td>
		<td name="brand" style="background-color:#f3f2f2" th:text="${item.brand}"></td>
		<td name="measurementUnit" style="background-color:#f3f2f2" th:text="${item.measurementUnit}"></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;">
			<select name="storeage" lay-filter="storeage" >
				<option th:each="s : ${stockStore}" th:attr="value=${s.id}" th:text="${s.name}" th:selected="(${item.storeage}==${s.name})"></option>
		    </select>
		</td>
		<td name="customerMateriaCode" style="background-color:#f3f2f2" th:text="${item.customerMateriaCode}"></td>
		<td name="customerMateriaName" style="background-color:#f3f2f2" th:text="${item.customerMateriaName}"></td>
		<td name="customerMateriaSpec" style="background-color:#f3f2f2" th:text="${item.customerMateriaSpec}"></td>
		<td name="quantityDue" style="background-color:#f3f2f2" th:text="${item.quantityDue}"></td>
		<td style="background-color:#f3f2f2" th:text="${item.deliveredQuantity}"/></td>
		<td><input style="width:80px;" type="text" name="actualdDelivery" required  lay-verify="required|number" placeholder="本次数量" autocomplete="off" class="layui-input" th:value="${item.actualdDelivery}"/></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;">
			<select name="isGift" lay-filter="statementTypeId" >
				<option value="0" th:if="${item.isGift == 0}">否</option>
				<option value="1">是</option>
				<option value="0">否</option>
		    </select>
		</td>
		<td><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input" th:value="${item.price}"/></td>
<!-- 		<td><span name="outboundDate" th:text="${#dates.format(item.outboundDate, 'yyyy-MM-dd HH:mm:ss')}"></span></td>   --->
		<td><input type="text" style="width:180px;" name="outboundDate" th:value="${item.outboundDate==null?'':#dates.format(item.outboundDate, 'yyyy-MM-dd HH:mm:ss')}" class="layui-input outboundDate" id="outboundDate"></td>
	</tr>
	</tbody>
</table>
<table style="display:none;" id="blankTpl">
<tbody>
<tr>
		<td><input type="checkBox" lay-skin="primary" name="trCheckBox" lay-filter="trCheckBox"/></td>
		<td style="width:50px"><input type="hidden" name="outboundId" value=""/><span th:text="${stockOutbound.billNo}"></span></td>
		<td>
			<input type="text" name="materiaCode" class="layui-input" style="width:120px;" value=""/>
			<input type="hidden" name="materialId" class="layui-input" value=""/>
		</td>
		<td name='materiaName' style="background-color:#f3f2f2;width:200px;"><span></span></td>
		<td name='materiaSpec' style="background-color:#f3f2f2"></td>
		<td name="materiaType" style="background-color:#f3f2f2"></td>
		<td name="brand" style="background-color:#f3f2f2"></td>
		<td name="measurementUnit" style="background-color:#f3f2f2"></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;">
			<select name="storeage" lay-filter="storeage" >
				<option th:each="s : ${stockStore}" th:attr="value=${s.id}" th:text="${s.name}"></option>
		    </select>
		</td>
		<td name="customerMateriaCode" style="background-color:#f3f2f2"></td>
		<td name="customerMateriaName" style="background-color:#f3f2f2"></td>
		<td name="customerMateriaSpec" style="background-color:#f3f2f2"></td>
		<td><input style="width:80px;" type="text" name="quantityDue" required  lay-verify="required|number" placeholder="应发数量" autocomplete="off" class="layui-input"></td>
		<td name="deliveredQuantity" style="background-color:#f3f2f2"></td>
		<td><input style="width:80px;" type="text" name="actualdDelivery" required  lay-verify="required|number" placeholder="本次数量" autocomplete="off" class="layui-input"></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;">
			<select name="isGift" lay-filter="statementTypeId" >
				<option value="0">否</option>
				<option value="1">是</option>
		    </select>
		</td>
		<td><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input"></td>
		<td><input type="text" style="width:180px;" name="outboundDate" class="layui-input outboundDate" id="outboundDate"></td>
	</tr>
	</tbody>
</table>
<script>
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  lay('.outboundDate').each(function(){
		    laydate.render({
		      elem: this
		      ,type:'datetime'
		      ,trigger: 'click'
		    });
		  });
	});
</script>